/// @tags: OGF
#include <cctype>
#include <cstdio>

namespace BlueQuantum {

typedef long long ll;
int const N = 15, mod = 2004;

template <typename T>
inline T &read(T &x) {
  x = 0;
  bool f = false;
  short ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = true;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + (ch ^ '0'), ch = getchar();
  if (f) x = -x;
  return x;
}

int n, l, r;
ll a[N], fac = 1, sum;

inline ll C(int x, int y) {
  ll M = mod * fac, ans = 1;
  for (int i = y - x + 1; i <= y; i++) ans = (ans * i) % M;
  return (ans / fac) % mod;
}

void dfs(int step, int val, int exp, int lim) {
  if (exp > lim) return;
  if (step == n + 1) {
    sum += 1ll * val * C(n, n + lim - exp) % mod;
    if (sum >= mod) sum -= mod;
    return;
  }
  dfs(step + 1, val, exp, lim), dfs(step + 1, -val, exp + a[step] + 1, lim);
}

inline ll solve(int lim) {
  sum = 0;
  dfs(1, 1, 0, lim);
  return (sum % mod + mod) % mod;
}

inline int main() {
  read(n), read(l), read(r);
  for (int i = 1; i <= n; i++)  read(a[i]), fac = fac * i;
  printf("%lld", ((solve(r) - solve(l - 1)) % mod + mod) % mod);
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("P6078 [CEOI2004] Sweets.in", "r", stdin);
  freopen("P6078 [CEOI2004] Sweets.out", "w", stdout);
#endif
#endif

  return BlueQuantum::main();
}